#!/usr/bin/env bash


rm -rf /opt/docker/harbor

mkdir -p /opt/docker && chmod a+rwx /opt/docker -R
mkdir -p /mnt/harbor && chmod a+rwx /mnt/harbor -R

# https://github.com/goharbor/harbor/releases
wget https://github.com/goharbor/harbor/releases/download/v2.4.2/harbor-offline-installer-v2.4.2.tgz  -P ./ -N

tar zxvf harbor-offline-installer-v*.tgz -C /opt/docker

echo "解压完成，copy..."
\cp -rf harbor.yml /opt/docker/harbor/
echo "正在安装..."
bash /opt/docker/harbor/install.sh

# 设置自启
for i in `docker ps -a | grep harbor | awk '{print $NF}'`
do
  docker update --restart=unless-stopped $i
done



docker login udi:8702 -u admin -p Harbor12345





